//
//  QMAReportModel.h
//  MiniAppSDK
//
//  Created by linseyzhou on 2019/9/19.
//

#import <Foundation/Foundation.h>
#import "QQModelObject.h"

NS_ASSUME_NONNULL_BEGIN

#define QMAReportModelKey @"QMAReportModelKey"

@interface QMAReport05115Model : QQModelObject

// 特殊字段，用以计算耗时
@property (nonatomic, assign) CFAbsoluteTime mStartTime;


/*
 * 对应手Q QQReport05115Model
 * 注释的属性可以在手Q里面赋值上报
 */
@property (nonatomic, strong) NSString *miniappid;
@property (nonatomic, strong) NSString *launch_flag;
@property (nonatomic, assign) NSInteger launch_cost;
@property (nonatomic, assign) NSInteger relaunch_cost;
@property (nonatomic, assign) NSInteger pkg_download_cost;
@property (nonatomic, strong) NSString *pkg_download_result;

// just小游戏
@property (nonatomic, assign) NSInteger game_prepare_cost;
@property (nonatomic, assign) NSInteger fps_avg;
@property (nonatomic, assign) NSInteger fps_vari;
//

@property (nonatomic, assign) NSInteger cpu_avg;
@property (nonatomic, assign) NSInteger mem_avg;
@property (nonatomic, assign) NSInteger mem_inc;
@property (nonatomic, assign) NSInteger http_request_cost;
@property (nonatomic, assign) NSInteger http_request_num;
@property (nonatomic, assign) NSInteger http_request_error_num;
@property (nonatomic, assign) NSInteger http_request_length;
@property (nonatomic, assign) NSInteger download_request_cost;
@property (nonatomic, assign) NSInteger download_request_num;
@property (nonatomic, assign) NSInteger download_request_error_num;
@property (nonatomic, assign) NSInteger download_request_length;
@property (nonatomic, assign) NSInteger js_error_num;
@property (nonatomic, assign) NSInteger oom_error_num; // 因为5s内两次内存警告被杀时上报，值为0 or 1
@property (nonatomic, assign) NSInteger crash_error_num;
@property (nonatomic, strong) NSString *launch_result;
@property (nonatomic, assign) NSInteger game_use_time;
@property (nonatomic, strong) NSString *scene;
//@property (nonatomic, assign) NSInteger timestamp;
@property (nonatomic, strong) NSString *app_type;
//@property (nonatomic, strong) NSString *network_type;
@property (nonatomic, strong) NSString *qua;
@property (nonatomic, strong) NSString *client_version;
@property (nonatomic, strong) NSString *miniapp_version;
@property (nonatomic, strong) NSString *baselib_version;

// 进行上报
- (void)report;

@end

@interface QMAReport05116Model : NSObject

/*
* 对应手Q QQReport05116Model
* 注释的属性可以在手Q里面赋值上报
*/
@property (nonatomic, strong) NSString *miniappid;
@property (nonatomic, strong) NSString *request_url;
@property (nonatomic, strong) NSString *request_type;
@property (nonatomic, strong) NSString *request_result;
@property (nonatomic, assign) NSInteger request_cost;
@property (nonatomic, assign) NSInteger request_length;
@property (nonatomic, strong) NSString *domain;
@property (nonatomic, strong) NSString *request_url_no_query;
//@property (nonatomic, strong) NSString *network_type;
@property (nonatomic, strong) NSString *app_type;
//@property (nonatomic, strong) NSString *device_platform;
//@property (nonatomic, assign) NSInteger timestamp;

// (小游戏使用)
@property (nonatomic, strong) NSString *error_msg;  // 错误信息
@property (nonatomic, assign) BOOL is_hit_sample;   // 是否命中采样

@end

/// 请求开始模型（小游戏使用）
@interface QMAReportRequstStartModel : NSObject

@property (nonatomic, strong) NSString *request_url;    // url
@property (nonatomic, strong) NSString *request_type;   // 请求类型
@property (nonatomic, assign) BOOL is_hit_sample;       // 是否命中采样
@property (nonatomic, strong) NSString *request_url_no_query;   // 没有query的url

@end

NS_ASSUME_NONNULL_END
